Release 10.1A: OpenEdge Data Management:
SQL Reference
OPEN
Executes a prepared SQL query associated with a cursor and creates a result set composed of the rows that satisfy the query. This set of rows is called the active set.
Syntax
cursor_nameAn identifier named in an earlier
DECLARECURSORstatement.USING [ SQL ] DESCRIPTOR structure_nameDirects the SQL engine to create the result set in storage addressed by the identified SQLDA structure.
USING :host_variable [ [ INDICATOR ] :ind_variable ]Directs the SQL engine to create the result set in storage addressed by host variables.
Example
Notes
- Executing an
OPENcursor statement sets the cursor to the open state.- After the
OPENcursor statement is executed, the cursor is positioned just before the first row of the active set.- For a single execution of an
OPENcursor statement, the active set does not change and the host variables are not re-examined.- If you elect to retrieve a new active set and a host variable value has changed, you must
CLOSEthe cursor andOPENit again.- Execution of a
COMMITstatement orROLLBACKstatement implicitly closes the cursors that have been opened in the current transaction.- It is good practice to
CLOSEcursors explicitly.- When a cursor is in the open state, executing an
OPENstatement on that cursor results in an error.- If a
DECLAREcursor statement is associated with a static SQL statement containing parameter markers, the following requirements apply:
- You must execute the
DECLAREstatement before executing theOPENstatement for that cursor.- The
DECLAREcursor statement and theOPENstatement for the same cursor must occur in the same transaction.- If the statement contains parameter markers for stack variables, the
DECLAREcursor statement and the followingOPENstatement for the same cursor must occur in the same C language function.Authorization
Must have DBA privilege of
SELECTprivilege on all the tables and views referenced in theSELECTstatement associated with the cursor.Related statements
DECLARE CURSOR, CLOSE, FETCH, positioned UPDATE, positioned DELETE
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |